# Michael Depuy
# depuym@onid.orst.edu
# CS311-400
# Homework 4


all: myar sig_demo

sig_demo.o: sig_demo.c
	gcc -Wall sig_demo.c

sig_demo: sig_demo.o
	gcc -o sig_demo sig_demo.c

myar.o: myar.c
	gcc -Wall myar.c

myar: myar.o
	gcc -o myar myar.c

testq12345:
	rm -f ar12345.ar myar12345.ar
	ar -q ar12345.ar
	myar12345.ar

testt12345:
	rm -f ar12345.ar
	ar -q ar12345.ar 1-s.txt 2-s.txt 3-s.txt 4-s.txt 5-s.txt
	ar -t ar12345.ar > ar-ctoc.txt myar -t ar12345.ar > myar-ctoc.txt
	diff ar-ctoc.txt myar-ctoc.txt

testt135:
	rm -f ar135.ar
	ar -q ar135.ar 1-s.txt 3-s.txt 5-s.txt
	ar -t ar135.ar > ar-ctoc.txt myar -t ar135.ar > myar-ctoc.txt
	diff ar-ctoc.txt myar-ctoc.txt

testt24:
	rm -f ar24.ar
	ar -q ar24.ar 2-s.txt 4-s.txt
	ar -t ar24.ar > ar-ctoc.txt myar -t ar24.ar > myar-ctoc.txt
	diff ar-ctoc.txt myar-ctoc.txt

testt: testt12345 testt135 testt24

testv12345:
	rm -f ar12345.ar
	ar -q ar12345.ar 1-s.txt 2-s.txt 3-s.txt 4-s.txt 5-s.txt
	ar -v ar12345.ar > ar-ctoc.txt myar -v ar12345.ar > myar-ctoc.txt
	diff ar-ctoc.txt myar-ctoc.txt

testv135:
	rm -f ar135.ar
	ar -q ar135.ar 1-s.txt 3-s.txt 5-s.txt
	ar -v ar135.ar > ar-ctoc.txt myar -v ar135.ar > myar-ctoc.txt
	diff ar-ctoc.txt myar-ctoc.txt

testv24:
	rm -f ar24.ar
	ar -q ar24.ar 2-s.txt 4-s.txt
	ar -v ar12345.ar > ar-ctoc.txt myar -v ar12345.ar > myar-ctoc.txt
	diff ar-ctoc.txt myar-ctoc.txt

testv: testv12345 testv135 testv24

clean:
	rm *.o *.exe *.c~ *.o~ *.ar *.exe~ *.out myar sig_demo Makefile~ ar-ctoc.txt myar-ctoc.txt